{
 "cells": [
  {
   "cell_type": "code",
   "id": "initial_id",
   "metadata": {
    "collapsed": true,
    "ExecuteTime": {
     "end_time": "2025-03-26T10:46:06.363698Z",
     "start_time": "2025-03-26T10:46:01.392418Z"
    }
   },
   "source": "import torch",
   "outputs": [],
   "execution_count": 1
  },
  {
   "metadata": {
    "ExecuteTime": {
     "end_time": "2025-03-26T10:46:07.966763Z",
     "start_time": "2025-03-26T10:46:07.961133Z"
    }
   },
   "cell_type": "code",
   "source": [
    "# 查看当前PyTorch版本\n",
    "print(torch.__version__)"
   ],
   "id": "ca2fae1921471061",
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "2.6.0+cu118\n"
     ]
    }
   ],
   "execution_count": 2
  },
  {
   "metadata": {
    "ExecuteTime": {
     "end_time": "2025-03-26T10:46:11.476230Z",
     "start_time": "2025-03-26T10:46:11.468008Z"
    }
   },
   "cell_type": "code",
   "source": [
    "# 查看当前PyTorch配置\n",
    "print(torch.backends.cudnn.version())  # 90100是cuDNN版本号"
   ],
   "id": "56a84710d23182d4",
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "90100\n"
     ]
    }
   ],
   "execution_count": 3
  },
  {
   "metadata": {
    "ExecuteTime": {
     "end_time": "2025-03-26T10:46:15.999180Z",
     "start_time": "2025-03-26T10:46:15.990450Z"
    }
   },
   "cell_type": "code",
   "source": [
    "# 查看当前PyTorch CUDA版本\n",
    "print(torch.version.cuda)"
   ],
   "id": "61bc67768837695a",
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "11.8\n"
     ]
    }
   ],
   "execution_count": 4
  },
  {
   "metadata": {
    "ExecuteTime": {
     "end_time": "2025-03-26T10:46:19.828424Z",
     "start_time": "2025-03-26T10:46:19.692097Z"
    }
   },
   "cell_type": "code",
   "source": [
    "# 查看当前PyTorch是否支持CUDA\n",
    "print(torch.cuda.is_available())"
   ],
   "id": "65597e45b86fb27a",
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "True\n"
     ]
    }
   ],
   "execution_count": 5
  },
  {
   "metadata": {
    "ExecuteTime": {
     "end_time": "2025-03-26T10:46:26.367894Z",
     "start_time": "2025-03-26T10:46:26.360482Z"
    }
   },
   "cell_type": "code",
   "source": [
    "# 查看当前PyTorch GPU数量\n",
    "print(torch.cuda.device_count())"
   ],
   "id": "307904e75d2b896d",
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "1\n"
     ]
    }
   ],
   "execution_count": 6
  },
  {
   "metadata": {
    "ExecuteTime": {
     "end_time": "2025-03-26T10:46:29.390396Z",
     "start_time": "2025-03-26T10:46:29.372198Z"
    }
   },
   "cell_type": "code",
   "source": [
    "# 查看当前PyTorch GPU名称\n",
    "print(torch.cuda.get_device_name(0))"
   ],
   "id": "6a86550075264fce",
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "NVIDIA GeForce GTX 1650\n"
     ]
    }
   ],
   "execution_count": 7
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 2
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython2",
   "version": "2.7.6"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 5
}
